package ClassHomeworkTest;
/*
丈夫和妻子测试类
 */
public class HusbandAndWifeTest {
    public static void main(String[] args){
        Husband h1 = new Husband("12138","张三","2000-10-1");
        Wife w1 = new Wife("12139","李四","1999-10-1",h1);
        //w1 = null; //发生空指针异常
        h1.setWife(w1);
        System.out.println(h1.getId()+" "+h1.getName()+" "+h1.getDate()+" "+h1.getWife().getName());
        System.out.println(w1.getId()+" "+w1.getName()+" "+w1.getDate()+" "+w1.getHusband().getName());
    }
}
